<div class="wrapper-xs" ng-init="vm.init()">
    <form class="form-validation w5c-form" w5c-form-validate="{}" w5c-submit="vm.submit()" novalidate
          name="validateForm">
        <div class="panel panel-default">
            <div class="panel-heading font-bold">销售开单</div>
            <!-- <div class="panel-body form-inline">
                 <div class="form-group col-sm-12">
                     <label class="control-label">销售客户:</label>
                     <input type="text" class="form-control input-sm"  label="销售客户"
                            name="order.name" ng-model="vm.order.name" ng-maxlength="30" required/>
                 </div>
                 <div class="line line-dashed b-b "></div>
                 <div class="form-group col-sm-12">
                     <label class="control-label">选择产品:</label>
                     <input type="text" class="form-control input-sm"  label="产品"
                            name="order.itemNo" ng-model="vm.order.itemNo" ng-maxlength="50" required/>
                 </div>
             </div>-->
            <div class="panel-body">
                <form class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-1 control-label">销售客户</label>
                        <div class="col-sm-5 input-group">
                            <ui-select ng-model="vm.order.customer" theme="bootstrap">
                                <ui-select-match placeholder="选择或搜索销售客户">{{$select.selected.name}}</ui-select-match>
                                <ui-select-choices repeat="item in vm.customerList | filter: $select.search">
                                    <span ng-bind-html="item.name | highlight: $select.search"></span>
                                    <small ng-bind-html="item.email | highlight: $select.search"></small>
                                </ui-select-choices>
                            </ui-select>
                            <span class="input-group-btn">
                                  <a ng-click="vm.order.customer = undefined" class="btn btn-default">
                                    <span class="glyphicon glyphicon-trash"></span>
                                  </a>
                                </span>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label">选择产品</label>
                        <div class="col-sm-5 input-group">
                            <input type="text" class="form-control input-sm" label="产品"
                                   name="order.name" ng-model="vm.order.product" ng-maxlength="30" required/>
                            <span class="input-group-btn">
                                    <button type="button" class="btn btn-default input-sm" ng-click="vm.openProduct()">
                                        <i class="icon-magnifier-add"></i>
                                    </button>
                                </span>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                        <div class="col-sm-12">
                            <div class="table-responsive">
                                <table ng-table="vm.tableParam"
                                       class="table table-condensed table-bordered table-hover table table-striped table-bordered">
                                    <tbody>
                                    <tr ng-repeat="row in $data track by $index">
                                        <td title="'序号'" sortable="'id'" align="center" width="10px">{{row.id}}</td>
                                        <td title="'产品名称'" sortable="'productName'">{{row.productName}}</td>
                                        <td title="'货号'" sortable="'itemNo'">{{row.itemNo}}</td>
                                        <td title="'单价'" sortable="'saleAmt'">{{row.saleAmt}}</td>
                                        <td title="'数量'" sortable="'number'">{{row.number}}</td>
                                        <td title="'销售金额'" sortable="'salePrice'">{{row.salePrice}}</td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-10">
                            <button type="submit" class="btn btn-primary">创建订单</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </form>
</div>

<div ng-include="'views/common/win/productListWin.html'" id="productList"
     style="display: none;height:500px;width: 900px;"></div>
